package com.state.impl;

import com.state.GumballMachine;
import com.state.face.State;

/**
 * 无25美分状态
 * 
 * @author Administrator
 * 
 */
public class NoQuarterState implements State {
	GumballMachine gumballMachine;

	public NoQuarterState(GumballMachine gumballMachine) {
		this.gumballMachine = gumballMachine;
	}

	public void insertQuarter() {
		System.out.println("你投入了25美分");
		gumballMachine.setState(gumballMachine.getHasQuarterState());
	}

	public void ejectQuarter() {
		System.out.println("你还没有投入25美分");
	}

	public boolean turnCrank() {
		System.out.println("转动曲柄，但你还没有投入25美分");
		return false;
	}

	public void dispense() {
		System.out.println("无法出糖果");
	}

	public String toString() {
		return "等待投入25美分";
	}
}
